<template>
	<view class="postDetail">
		<PostItem :id="props.id" :title='props.title' :content='props.content' :username='props.username'
			:likeNum='props.likeNum' :commentNum='props.commentNum上' :avatarUrl='props.avatarUrl'
			:date='props.date' :ifDetail='true' :ifAudit='props.ifAudit' />
		<CommentList />
		<view class="newComment">
			<NewComment />
		</view>
	</view>

</template>

<script setup>
	import {
		onMounted,
		ref
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	import PostItem from '@/pages/index/components/PostItem.vue';
	import CommentList from './components/CommentList.vue'
	import NewComment from './components/NewComment.vue';
	// onMounted(() => {
	// 	const pages = getCurrentPages();
	// 	const page = pages[pages.length - 1];
	// });
	const id = ref(0)
	const ifAudit = ref(false)
	const props = ref({})
	onLoad((options) => {
		id.value = options.id
		// 处理json数据
		props.value = JSON.parse(options.props)
	})
	onMounted(() => {
		//做数据处理
	})
</script>
<style lang="less" scoped>
	.postDetail {

		.newComment {
			position: absolute;
			width: 100%;
			bottom: 0;
			left: 0;
		}
	}
</style>